/**
 * Copyright (C) 2019 Baidu, Inc. All Rights Reserved.
 */
package com.bailiban.service.impl;

import java.util.List;

import com.bailiban.dao.TicketsDao;
import com.bailiban.dao.impl.TicketsDaoImpl;
import com.bailiban.pojo.Tickets;
import com.bailiban.service.TicketsService;
import com.bailiban.utils.ResultMsg;

/**
 * @author zhulang
 * @version 创建时间：2019年9月28日 上午10:33:38
 */
public class TicketsServiceImpl implements TicketsService {
    private TicketsDao ticketsDao = new TicketsDaoImpl();

    /*
     * (non-Javadoc)
     * 
     * @see com.bailiban.service.TicketsService#findAllTickets()
     */
    @Override
    public List<Tickets> findAllTickets() {

        List<Tickets> list = ticketsDao.findAllTickets();
        System.out.println("-------------从数据库中查询数据-------------");
        return list;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.bailiban.service.TicketsService#findTicketsByTid(int)
     */
    @Override
    public Tickets findTicketsByTid(int tid) {
        Tickets tickets = ticketsDao.findTicketsByTid(tid);
        return tickets;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.bailiban.service.TicketsService#addTickets(com.bailiban.pojo.Tickets)
     */
    @Override
    public ResultMsg addTickets(Tickets tickets) {
        ResultMsg resultMsg = ticketsDao.addTickets(tickets);
        return resultMsg;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.bailiban.service.TicketsService#updateTickets(com.bailiban.pojo.Tickets)
     */
    @Override
    public ResultMsg updateTickets(Tickets tickets) {
        ResultMsg resultMsg = ticketsDao.updateTickets(tickets);
        return resultMsg;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.bailiban.service.TicketsService#deleteTicketsByTid(int)
     */
    @Override
    public ResultMsg deleteTicketsByTids(List<Integer> tids) {
        ResultMsg resultMsg = ticketsDao.deleteTicketsByTids(tids);
        return resultMsg;
    }

}
